<?php
use \app\service\DataHelper;
use \app\service\UrlService;
use yii\widgets\LinkPager;

/*
 * @var $pagination app\controllers\ClassController;
 * */

use app\service\StaticService;
StaticService::includeAppCssStatic('/css/classadd.css',\app\assets\AppAsset::className());
StaticService::includeAppJsStatic('/js/class/index.js',\app\assets\AppAsset::className());

?>
<div class="row">
    <div class="col-xs-9 col-sm-9 col-md-9  col-lg-9">
        <h5>班级列表</h5>
    </div>
    <div class="col-xs-3 col-sm-3 col-md-3  col-lg-3">
        <a href="<?=UrlService::buildNullUrl();?>" class="btn btn-link pull-right" id="addclass">添加班级</a>
    </div>
</div>
<hr/>
<div  id="mainborder" >
    <div class="table-responsive">
        <table class="table table-bordered">
            <thead>
            <tr>
                <td>序号</td>
                <th>班级名称</th>
                <th>班主任</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <?php if( $data ):?>
                <?php foreach( $data as $_key => $classinfo ):?>
                    <tr>
                        <td><?=$classinfo['classid'];?></td>
                        <td><?=$classinfo['name'];?></td>
                        <td><?=$classinfo['headmaster'];?></td>
                        <td>
                            <a href="<?=UrlService::buildUrl('/class/set',['classid' => $classinfo['classid']]);?>" class="btn btn-link">编辑</a>
                        </td>
                    </tr>
                <?php endforeach;?>
            <?php else:?>
                <tr> <td colspan="4">暂无班级</td> </tr>
            <?php endif;?>
            </tbody>
            <?=
                LinkPager::widget([
                    'pagination' => $pagination,
                ]);
            ?>
        </table>
    </div>
</div>

